<template>
  <div class="main">
    <el-container>
      <el-aside width="collapse">
        <!-- 左边的菜单栏 -->
        <Aside></Aside>
      </el-aside>
      <el-container>
        <!-- 中间的头部区域 -->
        <el-header>
          <main-header />
        </el-header>
        <!-- mian下二级路由展示区 -->
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import Aside from "@/views/main/cpns/Aside.vue";
import MainHeader from "@/components/MainHeader.vue";
import { createNamespacedHelpers, mapState, mapGetters, mapActions } from "vuex";
const {
  mapState: cartState,
  mapActions: cartActions,
  mapGetters: cartGetters,
  mapMutations: cartMutations,
} = createNamespacedHelpers("cart");

export default {
  props: {},
  components: {
    Aside,
    MainHeader,
  },
  data() {
    return {};
  },
  computed: {
    ...mapState("tab", ["name"]),
    ...mapGetters("tab", ["filters"]),
    ...mapState(["userName"]),
    ...cartState(["name", "userInfo"]),
  },
  watch: {},
  created() {},
  mounted() {},
  methods: {
    ...cartActions(["actChangeName"]),
    ...cartMutations(["changeUserInfo"]),
  },
};
</script>

<style scoped lang="less">
.main {
  height: 100%;
  width: 100%;

  cursor: pointer;
}
.el-container {
  height: 100%;
  // 设置文本不换行,超出隐藏
  // white-space: nowrap;
  // overflow: hidden;
  // text-overflow: ellipsis;
}
.el-aside {
  // height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  // text-align: left;
  cursor: pointer;
  //   transition: width 0.3s linear;
  scrollbar-width: none;
  -ms-overflow-style: none;
  &::-webkit-scrollbar {
    display: none;
  }
}
.el-header,
.el-footer {
  background-color: rgb(226, 226, 232);
  color: #333;
  // text-align: center;
  // line-height: 60px;
}

.el-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
  // text-align: center;
  // line-height: 160px;
}

body > .el-container {
  margin-bottom: 40px;
}
</style>
